Skip to content

feat: k×s evaluation/convolution coupling - #363

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/kxs-core
Jul 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/kxs-core

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Implements phase 2 of the k×s coupling (#362, design kxs_design.md approved): adaptive evaluation over-sampling now composes with oversampled PSF convolution — evaluate at per-pixel k_i·s, partially bin to the uniform s the Convolver requires, convolve, bin to image resolution.

  • binned_to_convolve_size_from + convolve_bin_segment_ids_from (bincount/segment_sum, trailing dims, identity fast path, divisibility guard).
  • Imaging validation relaxes equality → divisibility (adaptive Array2D legal when every entry % s == 0 — the one intentional behaviour change; guard tests updated).
  • Pixelizations: Mapper.mapping_matrix_over_sampled_for(s) — exact by linearity, built by direct scatter (fine-cell segment parents, 1/k² fractions), memory independent of k; 2b property = k=1 case, bit-for-bit.

Tests pinned to the phase-1 adaptive ground truth (exact); suites 863/946/336. Companion PyAutoGalaxy PR carries the call sites.

🤖 Generated with Claude Code

Adaptive evaluation now composes with oversampled PSF convolution: each
pixel evaluated at k_i * s is partially binned (mean per (k_i)^2 group) to
the uniform s the Convolver requires.

- over_sample_util.convolve_bin_segment_ids_from +
  binned_to_convolve_size_from (numpy bincount / jax segment_sum, trailing
  dims, identity fast path when all sizes equal s, divisibility guard).
- Imaging validation relaxes from equality to divisibility (adaptive
  Array2D legal when every entry % s == 0).
- Mapper.mapping_matrix_over_sampled_for(s): k x s for pixelizations via
  direct scatter — parents are fine-cell segment ids with fractions
  1/k_i^2, so the k_i*s-resolution intermediate is never materialised;
  exact by linearity (fold of folds = full fold, tested to 1e-14). The 2b
  property delegates to it with k=1.
- Inversion routes the psf's s to the mapper.

Tests pinned to the phase-1 adaptive ground truth (library reproduces the
brute-force k in {2,1} reference exactly); guard tests updated from the
equality rule to divisibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 8, 2026
@Jammy2211
Jammy2211 merged commit 1bbf022 into main Jul 8, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/kxs-core branch August 25, 2026 18:16
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant